﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) cndotnet.org Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.cndotnet.org/ezsocio
 * ==============================================================================*/
#endregion

#region Using

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CNdotnet.Ezsocio.EmailService;
using CNdotnet.Ezsocio.PluginFramework;

#endregion

namespace CNdotnet.Ezsocio.KeyWordsFilter
{
    [Extension]
    public class KeyWordsFilterExtension : PlugInContextBase
    {
        public override void Initialize()
        {
            MailHandler.BeforeEmailSent += new EventHandler<MailEventArgs>(OnBeforeEmailSent);
        }

        public override void Dispose()
        {
            MailHandler.BeforeEmailSent -= new EventHandler<MailEventArgs>(OnBeforeEmailSent);
        }

        private void OnBeforeEmailSent(object sender, MailEventArgs e)
        {
            string body = e.Body;

            // we'll add the filter feature in here.
        }
    }
}
